package gtkwire.widget;

import gtkwire.*;

/**
*A button to launch a font selection dialog.
*/
public class GtkFontButton extends GtkButton
{
	private String[] createFlag = null;//used to kill supers creating native widgets.

        public GtkFontButton()
        {
		super();
		this.widgetType = WT_GtkFontButton;
		createFlag = new String[0];
		gtkCreate();
		createFlag = null;
        }

        public GtkFontButton( String name, GladeKey key )
        {
		super( name, key );
		this.widgetType = WT_GtkFontButton;
        }
	
	protected String[] getCreateData(){ return createFlag; }

	/**
	*Retrieves the name of the currently selected font.
	*/
	public String getSelectedFont()
	{
		GTKWireMessage answer = app().sendCommandRequest( name, widgetType, GTKWireCommandRequest.GET_SELECTED_FONT, null );
		return (String) answer.getMessageObject();
	}

	/**
	*Sets or updates the currently-displayed font in font picker dialog.
	*/
	public void setSelectedFont( String font )
	{
		app().sendCommand( name, GTKWireCommandRequest.SET_FONT, font );
	}

	/**
	*If show_size is TRUE, the font size will be displayed along with the name of the selected font.
	*/
	public void setShowSize( boolean b )
	{
		app().sendCommand( name, GTKWireCommandRequest.SHOW_SIZE, b);
	}

	/**
	* Sets title of opened dialog.
	*/
	public void setDialogTitle( String title )
	{
		app().sendCommand( name, GTKWireCommand.SET_TITLE, title );
	}

}//end class